|
|
|
|
|
|
|
'strMsg = strMsg & "Password=" & rdoEnv.Password & vbCrLf
strMsg = strMsg & "UserName=" & rdoEnv.UserName & vbCrLf
strMsg = strMsg & vbCrLf
Next
'
MsgBox strMsg, vbInformation, "rdoEnvironment"
'
rdoNewEnv.Close
Set rdoEnv = Nothing
Set rdoNewEnv = Nothing
'
End Sub |
|
|
|
|
|
|
|
|
After you save and run the project, click the Environment button to display a dialog box similar to the one in Figure 18.8. |
|
|
|
|
|
|
|
|
Figure 18.8.
Displaying the rdoEnvironment properties. |
|
|
|
|
|
|
|
|
Notice that a default environment always is available to your application. It is advisable, however, to create your own environment before you attempt to establish a connection to remote data sources. |
|
|
|
|
|
|
|
|
The rdoConnection object contains the details needed to establish a connection between your application and the remote data source. The rdoConnection object is similar to the Microsoft Jet Database object. |
|
|
|
|
|
|
|
|
You can create more than one rdoConnection object under the same rdoEnvironment object. All rdoConnection objects are stored in the rdoConnections collection. |
|
|
|
|
|
|
|
|
Add a new button to the form. Set its Name to cmdRDOConnection and its Caption to Connection. Then add the code in Listing 18.9 to the cmdRDOConnection_Click event. |
|
|
|
|
|